package tx.bj12320.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bj12320.model.*;
import tx.bj12320.dao.*;
import tx.bj12320.service.*;
import tx.bj12320.vo.query.*;


@Entity
@Table(name = "BJ12320_GRADE_ITEM")
public class GradeItem extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;

	//alias
	public static final String TABLE_ALIAS = "评分项目";
	public static final String ALIAS_GRADE_ITEM_ID = "gradeItemId";
	public static final String ALIAS_ACTIVITY_INFO_ID = "投诉转办流程环节办理信息ID";
	public static final String ALIAS_GRADE_ITEM_NAME = "评分项目名称";
	public static final String ALIAS_GRADE_TERM_NAME = "评分细项名称";
	public static final String ALIAS_GRADE_TERM_POINT = "评分细项分数";
	public static final String ALIAS_GRADE_TERM_SCORE = "评分细项得分";
	public static final String ALIAS_GRADE_EXPLAIN = "gradeExplain";

	//date formats


	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * gradeItemId       db_column: GRADE_ITEM_ID
     */
	
	private Long gradeItemId;
    /**
     * 投诉转办流程环节办理信息ID       db_column: ACTIVITY_INFO_ID
     */
	
	private Long activityInfoId;
    /**
     * 评分项目名称       db_column: GRADE_ITEM_NAME
     */
	@Length(max=200)
	private java.lang.String gradeItemName;
    /**
     * 评分细项名称       db_column: GRADE_TERM_NAME
     */
	@Length(max=200)
	private java.lang.String gradeTermName;
    /**
     * 评分细项分数       db_column: GRADE_TERM_POINT
     */
	
	private Long gradeTermPoint;
    /**
     * 评分细项得分       db_column: GRADE_TERM_SCORE
     */
	
	private Long gradeTermScore;
    /**
     * gradeExplain       db_column: GRADE_EXPLAIN
     */
	@Length(max=2000)
	private java.lang.String gradeExplain;
	//columns END


	public GradeItem(){
	}

	public GradeItem(
		Long gradeItemId
	){
		this.gradeItemId = gradeItemId;
	}



	public void setGradeItemId(Long value) {
		this.gradeItemId = value;
	}

	@Id	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="BJ12320_GRADE_ITEM_SEQU")
    @SequenceGenerator(name="BJ12320_GRADE_ITEM_SEQU",allocationSize=1,initialValue=1, sequenceName="BJ12320_GRADE_ITEM_SEQU")
	@Column(name = "GRADE_ITEM_ID", unique = true, nullable = false, insertable = true, updatable = true, length = 0)
	public Long getGradeItemId() {
		return this.gradeItemId;
	}

	@Column(name = "ACTIVITY_INFO_ID", unique = false, nullable = true, insertable = true, updatable = true, length = 0)
	public Long getActivityInfoId() {
		return this.activityInfoId;
	}

	public void setActivityInfoId(Long value) {
		this.activityInfoId = value;
	}

	@Column(name = "GRADE_ITEM_NAME", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getGradeItemName() {
		return this.gradeItemName;
	}

	public void setGradeItemName(java.lang.String value) {
		this.gradeItemName = value;
	}

	@Column(name = "GRADE_TERM_NAME", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getGradeTermName() {
		return this.gradeTermName;
	}

	public void setGradeTermName(java.lang.String value) {
		this.gradeTermName = value;
	}

	@Column(name = "GRADE_TERM_POINT", unique = false, nullable = true, insertable = true, updatable = true, length = 0)
	public Long getGradeTermPoint() {
		return this.gradeTermPoint;
	}

	public void setGradeTermPoint(Long value) {
		this.gradeTermPoint = value;
	}

	@Column(name = "GRADE_TERM_SCORE", unique = false, nullable = true, insertable = true, updatable = true, length = 0)
	public Long getGradeTermScore() {
		return this.gradeTermScore;
	}

	public void setGradeTermScore(Long value) {
		this.gradeTermScore = value;
	}

	@Column(name = "GRADE_EXPLAIN", unique = false, nullable = true, insertable = true, updatable = true, length = 2000)
	public java.lang.String getGradeExplain() {
		return this.gradeExplain;
	}

	public void setGradeExplain(java.lang.String value) {
		this.gradeExplain = value;
	}


	private ActivityInfo activityInfo;
	public void setActivityInfo(ActivityInfo activityInfo){
		this.activityInfo = activityInfo;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumns({
		@JoinColumn(name = "ACTIVITY_INFO_ID",nullable = false, insertable = false, updatable = false) 
	})
	public ActivityInfo getActivityInfo() {
		return activityInfo;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("GradeItemId",getGradeItemId())
			.append("ActivityInfoId",getActivityInfoId())
			.append("GradeItemName",getGradeItemName())
			.append("GradeTermName",getGradeTermName())
			.append("GradeTermPoint",getGradeTermPoint())
			.append("GradeTermScore",getGradeTermScore())
			.append("GradeExplain",getGradeExplain())
			.toString();
	}

	public int hashCode() {
		return new HashCodeBuilder()
			.append(getGradeItemId())
			.toHashCode();
	}

	public boolean equals(Object obj) {
		if(obj instanceof GradeItem == false) return false;
		if(this == obj) return true;
		GradeItem other = (GradeItem)obj;
		return new EqualsBuilder()
			.append(getGradeItemId(),other.getGradeItemId())
			.isEquals();
	}
}

